package com.scy.java.object.Extends;
//小孩类
public class kids extends ManKind{
    private int yearsOld;

    @Override
    public void employeed() {
        //super第一行调用父类的方法
//        super.employeed();
        System.out.println("孩子们应该学习而不是工作");
    }

    public kids(){
        //默认调用父类的无参构造器
        //隐式调用
//        super();
        System.out.println("我是子类的无参构造器");
    }
    public kids(int yearsOld) {
        this.yearsOld = yearsOld;
    }
    public kids(int sex, int sal, int yearsOld) {
        //调用父类构造器方法
//        super(sex, sal);
        this.yearsOld = yearsOld;
        setSal(sal);
        setSex(sex);
    }
    //打印年龄
    public void printAge(){
        System.out.println(yearsOld);
    }
    public int getYearsOld() {
        return yearsOld;
    }

    public void setYearsOld(int yearsOld) {
        this.yearsOld = yearsOld;
    }

    
}
